/*
 * @Author: zhangshu
 * @email: shiliang.zhang@tuya.com
 * @LastEditors: Please set LastEditors
 * @file name: app_gpio.h
 * @Description: 
 * @Copyright: HANGZHOU TUYA INFORMATION TECHNOLOGY CO.,LTD
 * @Company: http://www.tuya.com
 * @Date: 2022-02-08
 * @LastEditTime: 2022-02-08
 */
#ifndef __APP_GPIO_H__
#define __APP_GPIO_H__

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

#include "app_common.h"

//oem gpio struct
typedef struct {
    BOOL_T enabled;
    BOOL_T driver_flag;
    TUYA_GPIO_NUM_E pin_num;
} OEM_GPIO_INFO_T;

//app gpio struct
typedef struct {
    OEM_GPIO_INFO_T alarm;
    OEM_GPIO_INFO_T key;
    OEM_GPIO_INFO_T zll_scan_key;
    OEM_GPIO_INFO_T zll_factory_new_key;
} APP_GPIO_INFO_T;

/**
 * @description: app gpio interrupt init, include alarm tamper and trouble
 * @param[in] gpio_info: gpio info, please refer to APP_GPIO_INFO_T
 * @return: OPERATE_RET, success when OPRT_OK, or else
 */
OPERATE_RET app_gpio_oem_init(APP_GPIO_INFO_T *gpio_info);

/**
 * @description: gpio init after preheat time delay, gpio state may not stable during the preheat time
 * @param[in] none
 * @return: none
 */
VOID_T app_gpio_preheat_init(VOID_T);

#ifdef __cplusplus
}
#endif

#endif

